#ifndef __SINGLETON_H__
#define __SINGLETON_H__

template <class _T>
class Singleton
{
public:
	Singleton()
	{
	}
	~Singleton()
	{
	}
	static _T* instance()
	{
		if(!m_instance)
			m_instance = new _T;
		return m_instance;
	}
	static void release()
	{
		if (m_instance)
			delete m_instance;
		m_instance = 0;
	}
private:
	static _T* m_instance;
};


template<class _T>
_T* Singleton<_T>::m_instance=0;

#endif//__SINGLETON_H__
